import {createRouter, createWebHashHistory} from 'vue-router'
const loadView = (view) => () => import(/* webpackChunkName: "[request]" */ `@/views/${view}.vue`)

// 页面路由配置
const pages = {
    Main: loadView('Main'),
    Login: loadView('Login'),
}

// 路由配置
const routes = [
    {
        path: '/',
        component: pages.Main
    },
    {
        path: '/Login',
        component: pages.Login
    }
]

// 创建 router 实例
const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router
